package com.blockmeta.bbs.businesslibrary.pojo.websocket;

import java.util.HashMap;

/**
 * Created by bytom on 2018/4/3.
 */

public enum CompressMode {
    AutoSelect(CompressMethod.NONE),
    NoCompress(CompressMethod.NONE),
    GzipCompress(CompressMethod.GZIP);

    static HashMap<Byte, CompressMode> hmMap = new HashMap();
    CompressMethod m_cm;

    public static CompressMode getCompressMode(byte b) {
        return (CompressMode)hmMap.get(Byte.valueOf(b));
    }

    private CompressMode(CompressMethod cm) {
        this.m_cm = cm;
    }

    public boolean isNoComperss() {
        return this == NoCompress;
    }

    public byte getByte() {
        return (byte)this.m_cm.getValue();
    }

    static {
        CompressMode[] var0 = values();
        int var1 = var0.length;

        for(int var2 = 0; var2 < var1; ++var2) {
            CompressMode cm = var0[var2];
            if(cm != AutoSelect) {
                hmMap.put(Byte.valueOf(cm.getByte()), cm);
            }
        }

    }
}
